package testcase;


import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import entity.Pecies;

public class PeciesTest {
	private Pecies p;

	@Before
	public void setUp() throws Exception {
		p=new Pecies("/images/pieces/father.png","/images/pieces/father.png","Peter",10,80,80);
	}

	@After
	public void tearDown() throws Exception {
	}
	
	/**the following test all the initial value of a Pecies is correct or not*/
	@Test
	public void testInitialValue(){
		assertEquals("Peter",p.getName());
		assertEquals(10,p.getSelf());
		assertEquals(0,p.getCanvasY());
		assertEquals(0, p.getCanvasX());
		assertEquals(0,p.getItemNumber());
		assertEquals(null,p.getItemUsing());
	}
	
	@Test
	public void testSetSelf(){
		/**deduct the self;*/
		p.setSelf(-5);
		assertEquals(5,p.getSelf());
		
		/**add the self */
		p.setSelf(10);
		assertEquals(15,p.getSelf());
	}
}
